#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QWidget>
#include <QListWidgetItem>
#include <QtGui/QPixmap>
#include<QTcpSocket>
#include<QTcpServer>
#include <QtSql/QSqlQuery>
#include <QtSql/QSqlError>
#include <QDebug>
#include "user.h"
#include "historical.h"
#include "chat.h"
extern User mainuser;

namespace Ui {
class mainwindow;
}

class mainwindow : public QWidget
{
    Q_OBJECT



public:
    explicit mainwindow(QTcpSocket* sk, QWidget *parent = nullptr);
    ~mainwindow();

private slots:
    void on_pushButton_clicked();
    void on_chatroompushButton_clicked();
    void on_signaturelineEdit_editingFinished();
    void on_pushButton_2_clicked();
    void showIP(QByteArray b);
    void onItemDoubleClicked(QListWidgetItem *item);
private:
    Ui::mainwindow *ui;
    QTcpSocket *socket;
    QTcpSocket *socket_ip;
    QSqlDatabase db;
    int i =1;
    QByteArray other_IP;
};

#endif // MAINWINDOW_H
